FROM centos:7
MAINTAINER lusheng <2972631719@qq.com>

ADD jdk-8u221-linux-x64.tar.gz /usr/local
ADD apache-tomcat-8.5.90.tar.gz /usr/local

RUN rm -rf /etc/yum.repos.d/* && \
    echo '[base]' > /etc/yum.repos.d/aliyun.repo && \
    echo 'name=Aliyun Base' >> /etc/yum.repos.d/aliyun.repo && \
    echo 'baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/' >> /etc/yum.repos.d/aliyun.repo && \
    echo 'gpgcheck=0' >> /etc/yum.repos.d/aliyun.repo && \
    echo 'enabled=1' >> /etc/yum.repos.d/aliyun.repo && \
    yum clean all && \
    yum makecache fast

RUN yum install -y vim

ENV MYPATH /usr/local
WORKDIR $MYPATH

ENV JAVA_HOME /usr/local/jdk1.8.0_221
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools/jar
ENV CATALINT_HOME /usr/local/apache-tomcat-8.5.90.tar.gz
ENV CATALINT_BASE /usr/local/apache-tomcat-8.5.90.tar.gz
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINT_HOME/lib:$CATALINT_HOME/bin

EXPOSE 80

CMD /usr/local/apache-tomcat-8.5.90/bin/startup.sh && tail -F /usr/local/apache-tomcat-8.5.90/bin/logs/catalina.out
